//111 222 111111 444 555 777 101010

console.log(111);
const promise = new Promise((resolve, reject) => {
  reject();
  console.log(222);
});
promise
  .then(() => {
    console.log(333);
    return new Promise((resolve) => {
      reject();
    });
  })
  .catch(() => {
    console.log(444);
  })
  .then(() => {
    console.log(555);
    return new Promise((reject, resolve) => {
      reject();//第一个回调处理的是成功状态
      // resolve();
    });
  })
  .catch(() => {
    console.log(666);
    throw new Error("报错了~");
  })
  .then(() => {
    console.log(777);
    throw new Error("报错了~");
  })//返回失败的promise实例
  .then(() => console.log(888))//穿透
  .then(() => console.log(999))//穿透
  .catch(() => console.log(101010));
console.log(111111);